<template>
  <div class="mod-config">
    <table-view ref="view"
                :searchAttrs="searchAttrs"
                :primaryKey="primaryKey"
                :listApiName="listApiName"
                :saveAuthName="saveAuthName"
                :deleteAuthName="deleteAuthName"
                :showAttrs="showAttrs"
    >
    </table-view>
    <productinfo-add-or-update v-if="productInfoVisible" ref="productInfo"></productinfo-add-or-update>
    <client-info-add-or-update v-if="clientInfoVisible" ref="clientInfo"></client-info-add-or-update>
    <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
    <deep-category-add-or-update v-if="deepCategoryInfoVisible" ref="deepCategory" ></deep-category-add-or-update>
  </div>
</template>

<script>
  import AddOrUpdate from './deepstatementaccount-add-or-update'
  import tableView from '@/components/tableView'
  import basicMixins from '@/utils/commonViewMixins'
  import ProductinfoAddOrUpdate from '@/views/modules/product/productinfo-add-or-update'
  import ClientInfoAddOrUpdate from '@/views/modules/client/clientinfo-add-or-update'
  import DeepCategoryAddOrUpdate from '@/views/modules/deep/deepcategory-add-or-update'
  export default {
    mixins: [basicMixins],
    data () {
      return {
        searchAttrs: {
          productId: {
            type: 'autoComplete',
            placeholder: '请输入产品名称',
            querySearchApiName: 'productApi/getProductInfoList'
          },
          clientId: {
            label: '客户名称',
            clearable: true,
            type: 'autoComplete',
            placeholder: '请输入客户名称',
            querySearchApiName: 'clientApi/getClientList'
          },
          dateTimeRange: {
            type: 'date',
            dateType: 'daterange',
            clearable: true
          }
        },
        productInfoVisible: false,
        clientInfoVisible: false,
        deepCategoryInfoVisible: false,
        primaryKey: 'id',
        listApiName: 'deepApi/listDeepStatementAccount',
        deleteApiName: 'deepApi/deleteDeepStatementAccount',
        saveAuthName: 'deep:deepstatementaccount:save',
        deleteAuthName: 'deep:deepstatementaccount:delete',
        showAttrs: {
          orderNo: {
            label: '订单编号',
            width: 150
          },
          productNo: {
            label: '产品名称'
          },
          clientName: {
            label: '客户名'
          },
          orderSource:{
            label: '订单来源',
            type: 'radio',
            items: [
              {value: 0, text: '三和'},
              {value: 1, text: '来料加工', tagType: 'warning'}
            ]
          },
          realSaleNumber: {
            label: '销售数量'
          },
          productPrice: {
            label: '单价'
          },
          advancePayment: {
            label: '预付款'
          },
          totalSaleAmount: {
            label: '销售总额',
            width: 150
          },
          waitPayAmount: {
            label: '待支付金额',
            width: 150
          },
          remark: {
            label: '备注'
          }
        }
      }
    },
    components: {
      ProductinfoAddOrUpdate,
      ClientInfoAddOrUpdate,
      DeepCategoryAddOrUpdate,
      AddOrUpdate,
      tableView
    },
    methods: {

    }
  }
</script>
